home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Util / Archiver / GZip / GNU / man / cat1 / gzip.0 < prev    next >
Text File  |  1993-12-07  |  19KB  |  463 lines

  1.  
  2.  
  3.  
  4. GZIP(1)                                                   GZIP(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        gzip, gunzip, zcat - compress or expand files
  9.  
  10. SSYYNNOOPPSSIISS
  11.        ggzziipp [ --aaccddffhhllLLnnNNrrttvvVV1199 ] [--SS ssuuffffiixx] [ _n_a_m_e _._._.  ]
  12.        gguunnzziipp [ --aaccffhhllLLnnNNrrttvvVV ] [--SS ssuuffffiixx] [ _n_a_m_e _._._.  ]
  13.        zzccaatt [ --ffhhLLVV ] [ _n_a_m_e _._._.  ]
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.        _G_z_i_p  reduces the size of the named files using Lempel-Ziv
  17.        coding (LZ77).  Whenever possible, each file  is  replaced
  18.        by one with the extension ..ggzz,, while keeping the same own-
  19.        ership modes, access and modification times.  (The default
  20.        extension  is  --ggzz for VMS, zz for MSDOS, OS/2 FAT, Windows
  21.        NT FAT and Atari.)  If no files are  specified,  or  if  a
  22.        file  name is "-", the standard input is compressed to the
  23.        standard output.  _G_z_i_p will only attempt to compress regu-
  24.        lar  files.  In particular, it will ignore symbolic links.
  25.  
  26.        If the compressed file name is too long for its file  sys-
  27.        tem,  _g_z_i_p  truncates  it.  _G_z_i_p attempts to truncate only
  28.        the parts of the file name longer than 3  characters.   (A
  29.        part  is delimited by dots.) If the name consists of small
  30.        parts only, the longest parts are truncated. For  example,
  31.        if file names are limited to 14 characters, gzip.msdos.exe
  32.        is compressed to gzi.msd.exe.gz.  Names are not  truncated
  33.        on  systems which do not have a limit on file name length.
  34.  
  35.        By default, _g_z_i_p keeps the original file name  and  times-
  36.        tamp  in  the  compressed file. These are used when decom-
  37.        pressing the file with the --NN option. This is useful  when
  38.        the  compressed  file  name was truncated or when the time
  39.        stamp was not preserved after a file transfer.
  40.  
  41.        Compressed files can be restored to  their  original  form
  42.        using  _g_z_i_p  _-_d  or  _g_u_n_z_i_p or _z_c_a_t_.  If the original name
  43.        saved in the compressed file is not suitable for its  file
  44.        system, a new name is constructed from the original one to
  45.        make it legal.
  46.  
  47.        _g_u_n_z_i_p takes a list of  files  on  its  command  line  and
  48.        replaces  each file whose name ends with .gz, -gz, .z, -z,
  49.        _z or .Z and which begins with the  correct  magic  number
  50.        with  an uncompressed file without the original extension.
  51.        _g_u_n_z_i_p also recognizes the  special  extensions  ..ttggzz  and
  52.        ..ttaazz  as  shorthands  for ..ttaarr..ggzz and ..ttaarr..ZZ respectively.
  53.        When compressing, _g_z_i_p uses the ..ttggzz extension  if  neces-
  54.        sary instead of truncating a file with a ..ttaarr extension.
  55.  
  56.        _g_u_n_z_i_p  can  currently  decompress  files created by _g_z_i_p_,
  57.        _z_i_p_, _c_o_m_p_r_e_s_s_, _c_o_m_p_r_e_s_s _-_H or _p_a_c_k_.  The detection of  the
  58.        input  format is automatic.  When using the first two for-
  59.        mats, _g_u_n_z_i_p checks a 32 bit CRC. For _p_a_c_k_, _g_u_n_z_i_p  checks
  60.        the  uncompressed length. The standard _c_o_m_p_r_e_s_s format was
  61.  
  62.  
  63.  
  64.                               local                             1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GZIP(1)                                                   GZIP(1)
  71.  
  72.  
  73.        not designed to allow consistency checks.  However  _g_u_n_z_i_p
  74.        is  sometimes  able to detect a bad .Z file. If you get an
  75.        error when uncompressing a .Z file, do not assume that the
  76.        .Z  file is correct simply because the standard _u_n_c_o_m_p_r_e_s_s
  77.        does not complain. This generally means that the  standard
  78.        _u_n_c_o_m_p_r_e_s_s does not check its input, and happily generates
  79.        garbage output.  The SCO compress -H format (lzh  compres-
  80.        sion  method)  does not include a CRC but also allows some
  81.        consistency checks.
  82.  
  83.        Files created by _z_i_p can be uncompressed by gzip  only  if
  84.        they  have a single member compressed with the 'deflation'
  85.        method. This feature is only intended to  help  conversion
  86.        of  tar.zip  files  to  the  tar.gz format. To extract zip
  87.        files with several members, use _u_n_z_i_p instead of _g_u_n_z_i_p_.
  88.  
  89.        _z_c_a_t is identical to _g_u_n_z_i_p --cc..  (On  some  systems,  _z_c_a_t
  90.        may be installed as _g_z_c_a_t to preserve the original link to
  91.        _c_o_m_p_r_e_s_s_._)  _z_c_a_t uncompresses either a list  of  files  on
  92.        the  command  line  or  its  standard input and writes the
  93.        uncompressed data on standard output.   _z_c_a_t  will  uncom-
  94.        press  files  that  have  the correct magic number whether
  95.        they have a ..ggzz suffix or not.
  96.  
  97.        _G_z_i_p uses the Lempel-Ziv algorithm used in _z_i_p and  PKZIP.
  98.        The  amount of compression obtained depends on the size of
  99.        the input and the distribution of common substrings.  Typ-
  100.        ically,  text such as source code or English is reduced by
  101.        60-70%.  Compression is generally much  better  than  that
  102.        achieved  by LZW (as used in _c_o_m_p_r_e_s_s), Huffman coding (as
  103.        used in _p_a_c_k), or adaptive Huffman coding (_c_o_m_p_a_c_t).
  104.  
  105.        Compression is always performed, even  if  the  compressed
  106.        file  is slightly larger than the original. The worst case
  107.        expansion is a few bytes for the gzip file header, plus  5
  108.        bytes every 32K block, or an expansion ratio of 0.015% for
  109.        large files. Note that the  actual  number  of  used  disk
  110.        blocks  almost  never increases.  _g_z_i_p preserves the mode,
  111.        ownership and timestamps  of  files  when  compressing  or
  112.        decompressing.
  113.  
  114.  
  115. OOPPTTIIOONNSS
  116.        --aa ----aasscciiii
  117.               Ascii  text  mode: convert end-of-lines using local
  118.               conventions. This option is supported only on  some
  119.               non-Unix  systems. For MSDOS, CR LF is converted to
  120.               LF when compressing, and LF is converted to  CR  LF
  121.               when decompressing.
  122.  
  123.        --cc ----ssttddoouutt ----ttoo--ssttddoouutt
  124.               Write  output  on  standard  output;  keep original
  125.               files unchanged.  If there are several input files,
  126.               the  output consists of a sequence of independently
  127.  
  128.  
  129.  
  130.                               local                             2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GZIP(1)                                                   GZIP(1)
  137.  
  138.  
  139.               compressed members. To obtain  better  compression,
  140.               concatenate  all  input  files  before  compressing
  141.               them.
  142.  
  143.        --dd ----ddeeccoommpprreessss ----uunnccoommpprreessss
  144.               Decompress.
  145.  
  146.        --ff ----ffoorrccee
  147.               Force compression or decompression even if the file
  148.               has   multiple  links  or  the  corresponding  file
  149.               already exists, or if the compressed data  is  read
  150.               from or written to a terminal. If the input data is
  151.               not in a format recognized  by  _g_z_i_p_,  and  if  the
  152.               option  --stdout is also given, copy the input data
  153.               without change to  the  standard  ouput:  let  _z_c_a_t
  154.               behave  as  _c_a_t_.   If --ff is not given, and when not
  155.               running in the background, _g_z_i_p prompts  to  verify
  156.               whether an existing file should be overwritten.
  157.  
  158.        --hh ----hheellpp
  159.               Display a help screen and quit.
  160.  
  161.        --ll ----lliisstt
  162.               For   each  compressed  file,  list  the  following
  163.               fields:
  164.  
  165.                   compressed size: size of the compressed file
  166.                   uncompressed size:  size  of  the  uncompressed
  167.               file
  168.                   ratio: compression ratio (0.0% if unknown)
  169.                   uncompressed_name:  name  of  the  uncompressed
  170.               file
  171.  
  172.               The uncompressed size is given as -1 for files  not
  173.               in gzip format, such as compressed .Z files. To get
  174.               the uncompressed size for such a file, you can use:
  175.  
  176.                   zcat file.Z | wc -c
  177.  
  178.               In  combination with the --verbose option, the fol-
  179.               lowing fields are also displayed:
  180.  
  181.                   method: compression method
  182.                   crc: the 32-bit CRC of the uncompressed data
  183.                   date & time: time stamp  for  the  uncompressed
  184.               file
  185.  
  186.               The  compression  methods  currently  supported are
  187.               deflate, compress, lzh (SCO compress -H) and  pack.
  188.               The crc is given as ffffffff for a file not in gzip
  189.               format.
  190.  
  191.               With --name, the uncompressed name,  date and  time
  192.               are  those  stored  within  the  compress  file  if
  193.  
  194.  
  195.  
  196.                               local                             3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. GZIP(1)                                                   GZIP(1)
  203.  
  204.  
  205.               present.
  206.  
  207.               With --verbose, the  size  totals  and  compression
  208.               ratio  for all files is also displayed, unless some
  209.               sizes are unknown.  With  --quiet,  the  title  and
  210.               totals lines are not displayed.
  211.  
  212.        --LL ----lliicceennssee
  213.               Display the _g_z_i_p license and quit.
  214.  
  215.        --nn ----nnoo--nnaammee
  216.               When  compressing,  do  not  save the original file
  217.               name and time stamp by default. (The original  name
  218.               is  always  saved if the name had to be truncated.)
  219.               When decompressing, do  not  restore  the  original
  220.               file  name  if present (remove only the _g_z_i_p suffix
  221.               from the compressed file name) and do  not  restore
  222.               the  original  time  stamp if present (copy it from
  223.               the compressed file). This option  is  the  default
  224.               when decompressing.
  225.  
  226.        --NN ----nnaammee
  227.               When  compressing,  always  save  the original file
  228.               name and time stamp;  this  is  the  default.  When
  229.               decompressing,  restore  the original file name and
  230.               time stamp if present. This  option  is  useful  on
  231.               systems  which  have a limit on file name length or
  232.               when the time stamp has  been  lost  after  a  file
  233.               transfer.
  234.  
  235.        --qq ----qquuiieett
  236.               Suppress all warnings.
  237.  
  238.        --rr ----rreeccuurrssiivvee
  239.               Travel  the directory structure recursively. If any
  240.               of the file names specified on the command line are
  241.               directories,  _g_z_i_p  will descend into the directory
  242.               and compress all  the  files  it  finds  there  (or
  243.               decompress them in the case of _g_u_n_z_i_p ).
  244.  
  245.        --SS ..ssuuff ----ssuuffffiixx ..ssuuff
  246.               Use  suffix  .suf instead of .gz. Any suffix can be
  247.               given, but suffixes other than .z and .gz should be
  248.               avoided  to  avoid  confusion when files are trans-
  249.               ferred to other systems.  A null suffix forces gun-
  250.               zip  to   try  decompression  on  all  given  files
  251.               regardless of suffix, as in:
  252.  
  253.                   gunzip -S "" *       (*.* for MSDOS)
  254.  
  255.               Previous versions of gzip used the .z suffix.  This
  256.               was changed to avoid a conflict with _p_a_c_k(1)_.
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                               local                             4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. GZIP(1)                                                   GZIP(1)
  269.  
  270.  
  271.        --tt ----tteesstt
  272.               Test. Check the compressed file integrity.
  273.  
  274.        --vv ----vveerrbboossee
  275.               Verbose.  Display the name and percentage reduction
  276.               for each file compressed or decompressed.
  277.  
  278.        --VV ----vveerrssiioonn
  279.               Version. Display the version number and compilation
  280.               options then quit.
  281.  
  282.        --## ----ffaasstt ----bbeesstt
  283.               Regulate  the speed of compression using the speci-
  284.               fied digit _#, where  --11  or  ----ffaasstt  indicates  the
  285.               fastest  compression  method (less compression) and
  286.               --99 or  ----bbeesstt  indicates  the  slowest  compression
  287.               method (best compression).  The default compression
  288.               level is --66 (that is, biased towards high  compres-
  289.               sion at expense of speed).
  290.  
  291. AADDVVAANNCCEEDD UUSSAAGGEE
  292.        Multiple  compressed  files  can  be concatenated. In this
  293.        case, _g_u_n_z_i_p will extract all members at once.  For  exam-
  294.        ple:
  295.  
  296.              gzip -c file1  > foo.gz
  297.              gzip -c file2 >> foo.gz
  298.  
  299.        Then
  300.              gunzip -c foo
  301.  
  302.        is equivalent to
  303.  
  304.              cat file1 file2
  305.  
  306.        In  case of damage to one member of a .gz file, other mem-
  307.        bers can still be recovered  (if  the  damaged  member  is
  308.        removed).  However, you can get better compression by com-
  309.        pressing all members at once:
  310.  
  311.              cat file1 file2 | gzip > foo.gz
  312.  
  313.        compresses better than
  314.  
  315.              gzip -c file1 file2 > foo.gz
  316.  
  317.        If you want to recompress concatenated files to get better
  318.        compression, do:
  319.  
  320.              gzip -cd old.gz | gzip > new.gz
  321.  
  322.        If  a  compressed  file  consists  of several members, the
  323.        uncompressed size and CRC reported by  the  --list  option
  324.        applies   to  the  last  member  only.  If  you  need  the
  325.  
  326.  
  327.  
  328.                               local                             5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. GZIP(1)                                                   GZIP(1)
  335.  
  336.  
  337.        uncompressed size for all members, you can use:
  338.  
  339.              gzip -cd file.gz | wc -c
  340.  
  341.        If you wish to create a single archive file with  multiple
  342.        members  so  that  members can later be extracted indepen-
  343.        dently, use an archiver such as tar or zip. GNU  tar  sup-
  344.        ports  the -z option to invoke gzip transparently. gzip is
  345.        designed as a complement to tar, not as a replacement.
  346.  
  347. EENNVVIIRROONNMMEENNTT
  348.        The environment variable GGZZIIPP can hold a  set  of  default
  349.        options for _g_z_i_p_.  These options are interpreted first and
  350.        can be overwritten by explicit  command  line  parameters.
  351.        For example:
  352.              for sh:    GZIP="-8v --name"; export GZIP
  353.              for csh:   setenv GZIP "-8v --name"
  354.              for MSDOS: set GZIP=-8v --name
  355.  
  356.        On  Vax/VMS,  the  name  of  the  environment  variable is
  357.        GZIP_OPT, to avoid a conflict  with  the  symbol  set  for
  358.        invocation of the program.
  359.  
  360. SSEEEE AALLSSOO
  361.        znew(1),  zcmp(1),  zmore(1), zforce(1), gzexe(1), zip(1),
  362.        unzip(1), compress(1), pack(1), compact(1)
  363.  
  364. DDIIAAGGNNOOSSTTIICCSS
  365.        Exit status is normally 0; if an error occurs, exit status
  366.        is 1. If a warning occurs, exit status is 2.
  367.  
  368.        Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]
  369.                Invalid  options  were  specified  on  the command
  370.                line.
  371.        _f_i_l_e: not in gzip format
  372.                The file specified to _g_u_n_z_i_p  has  not  been  com-
  373.                pressed.
  374.        _f_i_l_e_: Corrupt input. Use zcat to recover some data.
  375.                The  compressed file has been damaged. The data up
  376.                to the point of failure can be recovered using
  377.                        zcat file > recover
  378.        _f_i_l_e: compressed with _x_x bits, can only handle _y_y bits
  379.                _F_i_l_e was compressed (using LZW) by a program  that
  380.                could deal with more _b_i_t_s than the decompress code
  381.                on this machine.  Recompress the file  with  gzip,
  382.                which compresses better and uses less memory.
  383.        _f_i_l_e: already has .gz suffix -- no change
  384.                The  file  is  assumed  to  be already compressed.
  385.                Rename the file and try again.
  386.        _f_i_l_e already exists; do you wish to overwrite (y or n)?
  387.                Respond "y" if you want  the  output  file  to  be
  388.                replaced; "n" if not.
  389.        gunzip: corrupt input
  390.                A  SIGSEGV  violation  was  detected which usually
  391.  
  392.  
  393.  
  394.                               local                             6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. GZIP(1)                                                   GZIP(1)
  401.  
  402.  
  403.                means that the input file has been corrupted.
  404.        _x_x_._x_%
  405.                Percentage of  the  input  saved  by  compression.
  406.                (Relevant only for --vv and --ll.)
  407.        -- not a regular file or directory: ignored
  408.                When  the  input  file  is  not  a regular file or
  409.                directory, (e.g. a symbolic  link,  socket,  FIFO,
  410.                device file), it is left unaltered.
  411.        -- has _x_x other links: unchanged
  412.                The  input  file  has links; it is left unchanged.
  413.                See _l_n(1) for more information. Use the --ff flag to
  414.                force compression of multiply-linked files.
  415.  
  416. CCAAVVEEAATTSS
  417.        When  writing  compressed  data to a tape, it is generally
  418.        necessary to pad the output with  zeroes  up  to  a  block
  419.        boundary.  When  the  data  is read and the whole block is
  420.        passed to _g_u_n_z_i_p for decompression,  _g_u_n_z_i_p  detects  that
  421.        there  is extra trailing garbage after the compressed data
  422.        and emits a warning  by  default.  You  have  to  use  the
  423.        --quiet option to suppress the warning. This option can be
  424.        set in the GGZZIIPP environment variable as in:
  425.          for sh:  GZIP="-q"  tar -xfz --block-compress /dev/rst0
  426.          for  csh:  (setenv  GZIP  -q;  tar  -xfz   --block-compr
  427.        /dev/rst0
  428.  
  429.        In the above example, gzip is invoked implicitly by the -z
  430.        option of GNU tar. Make sure that the same block size  (-b
  431.        option  of tar) is used for reading and writing compressed
  432.        data on tapes.  (This example assumes you  are  using  the
  433.        GNU version of tar.)
  434.  
  435. BBUUGGSS
  436.        The --list option reports incorrect sizes if they exceed 2
  437.        gigabytes.  The --list option reports sizes as -1 and  crc
  438.        as  ffffffff  if  the compressed file is on a non seekable
  439.        media.
  440.  
  441.        In some rare cases, the --best option gives worse compres-
  442.        sion  than  the  default  compression  level (-6). On some
  443.        highly redundant files, _c_o_m_p_r_e_s_s  compresses  better  than
  444.        _g_z_i_p_.
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                               local                             7
  461.  
  462.  
  463.